package com.knowif.util.commonUtil;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

/**
 * @author xingyao
 * @Description: set集合的工具类
 */
public class SetUtil {
	
	public static List<Object> set2List(Set<Object> objs){
		if(objs == null){
			return null;
		}
		List<Object> objList = new ArrayList<Object>();
		Iterator<Object> its = objs.iterator();
		while(its.hasNext()){
			objList.add(its.next());
		}
		return objList;
	}

	
	public static List<Integer> set2List4Int(Set<Integer> objs){
		if(objs == null){
			return null;
		}
		List<Integer> objList = new ArrayList<Integer>();
		Iterator<Integer> its = objs.iterator();
		while(its.hasNext()){
			objList.add(its.next());
		}
		return objList;
	}
}
